﻿@model GrandMan.Models.Admin.ArticleEditModel
@{
    ViewBag.Title = "联系我们--文章编辑";
    Layout = null; 
}
<link href="@Url.Content("~/Scripts/ueditor/themes/default/ueditor.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/ueditor/editor_config.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/ueditor/editor_ui_all_min.js")" type="text/javascript"></script>
    <script src="http://code.jquery.com/jquery-1.7.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    var editor;
    $(document).ready(function () {

        $('#editor').hide();

        editor = new baidu.editor.ui.Editor({
            UEDITOR_HOME_URL: '../../Scripts/ueditor/',
            iframeCssUrl: '../../Scripts/ueditor/themes/default/iframe.css',
            autoClearinitialContent: true,
            initialContent: '<span style="color:#ccc">请输入内容</span>',
            elementPathEnabled: false,
            minFrameHeight: 400
        });
        editor.render('editor');
        if ($(".content").attr("value") != "") {
            var str = $(".content").attr("value");
            editor.setContent(str);
        }


        $('#editor').show();
    });
    function sumbit() {
        $(".content").attr("value", editor.getContent());

    }
</script>
@using (Html.BeginForm())
{
    <div class="content-box-header">
        <h3>
            文章编辑</h3>
    </div>
    <div class="content-box-content">
        <div class="bulk-actions align-left">
            @Html.LabelFor(m => m.Name)
            @Html.TextBoxFor(m => m.Name)
            @Html.ValidationMessageFor(m => m.Name, new { style = "color:Red" })
        </div>
        <div>
            <div id='editor'>
            </div>
        </div>
        @Html.HiddenFor(m => m.Content, new { @class = "content" })
        @Html.HiddenFor(m => m.ID)
        @Html.HiddenFor(m => m.Type)
        @Html.HiddenFor(m => m.SubType)
        <p class="submit">
            <input type="submit" value="确定" class="input-submit" onclick="sumbit()" />
        </p>
    </div>
}
